
<template>
  <div class="fmodel-dialog-container">
    <el-dialog
      v-el-drag-dialog
      :close-on-click-modal="false"
      :visible.sync="fmodelDialog.fdetailModal"
      :append-to-body="true"
      class="fmodel-dialog-modal"
      title="明细"
      top="1vh"
      width="80%">
      <div class="fmodel-down">
        <el-button type="primary" icon="el-icon-my-export" @click="downData">导出</el-button>
      </div>
      <div class="fmodel-table">
        <el-table
          v-loading="fmodelDialog.listLoading"
          :data="fmodelDialog.tableData"
          :header-cell-style="tableHeaderStyle"
          class="tableCss"
          max-height="600"
          element-loading-text="正在加载"
          border
          highlight-current-row
          @selection-change="handleSelectionChange">
          <el-table-column
            type="selection"
            width="55"/>
          <template v-for="item in fmodelDialog.formThead">
            <el-table-column
              v-if="item.frpttypeflag ==0"
              :key="item.fid"
              :label="item.frepcap"
              :prop="item.frepfld"
              :width="item.frepwid"
              align="center"
              show-overflow-tooltip>

              <template slot-scope="scope">
                <template v-if="item.frephide<=0">
                  <template v-if="fmodelDialog.fstatuscg">
                    <template v-if="item.frepfld === 'fstatuscg'">
                      <el-tag v-if="Number(scope.row[item.frepfld]) === 1" size="mini" type="success">已审</el-tag>
                      <el-tag v-else size="mini" type="danger">未审</el-tag>
                    </template>
                    <template v-else size="mini">
                      {{ scope.row[item.frepfld] }}
                    </template>
                  </template>
                  <template v-else>
                    <template v-if="item.frepfld === 'fstatus'">
                      <el-tag v-if="Number(scope.row[item.frepfld]) === 1" size="mini" type="success">已审</el-tag>
                      <el-tag v-else size="mini" type="danger">未审</el-tag>
                    </template>
                    <template v-else size="mini">
                      {{ scope.row[item.frepfld] }}
                    </template>
                  </template>

                </template>
              </template>

            </el-table-column>
          </template>
        </el-table>

        <el-pagination
          :total="fmodelDialog.total"
          :page-sizes="fmodelDialog.pagesizes"
          :page-size="fmodelDialog.pagesize"
          :current-page.sync="fmodelDialog.currentPage"
          class="jy-pagination"
          style="text-align: center; margin-top: 20px;"
          background
          layout="sizes, prev, pager, next, total"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"/>
      </div>
    </el-dialog>

  </div>

</template>
<script>
import { common } from '../../mixins/common'
export default {
  name: 'FmodelDetails',
  mixins: [common],
  props: {
    fmodelDialog: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {}
  },
  watch: {
    fmodelDialog(val) {
      console.log(this.fmodelDialog, ' 2222')
    }
  },
  created() {
    console.log(this.fmodelDialog, ' this.fmodelDialog FmodelDetail')
    // console.log(this.lists, ' this.options')
  },
  methods: {
    async handleSelectionChange(val) {
      this.$emit('handleSelectionChange', val)
    },
    async handleSizeChange(val) {
      this.$emit('handleSizeChange', val)
    },
    async handleCurrentChange(val) {
      this.$emit('handleCurrentChange', val)
    },
    async downData() {
      this.$emit('downData')
    }
  }
}
</script>
<style scoped>
.fmodel-dialog-modal ::v-deep .el-dialog__body {
  padding: 0 20px;
}
.fmodel-down {
  margin-bottom: 20px;
}
.fmodel-dialog-modal ::v-deep .el-dialog__body {
  /* max-height: 750px!important; */
  overflow: scroll;
}
</style>
